<template>
  <div id="box">
    <div class="top">

      <el-input v-model="input"
                placeholder="输入要查询的管理员名称"
                class="input" />
      <el-button type="primary">查询</el-button>
      <el-button type="success">添加</el-button>
      <el-button type="danger" >删除</el-button>
    </div>

    <div class="center">

      <el-table

                :data="tableData.list"
                style="width: 100%"
           
                border
           
                >
        <el-table-column type="selection"
                         width="55" />
        <el-table-column property="deparmentname"
                         label="核销人姓名"
                         width="120" />

        <el-table-column property="mobile"
                         label="手机号"
                         width="120" />
        <el-table-column property="is_use"
                         label="部门"
                         width="120" />
        <el-table-column property="department"
                         label="职务" />
        <el-table-column property="is_use"
                         label="是否启动" />

        <el-table-column fixed="right"
                         label="操作">
          <template #default="scope">

            <el-button type="success">添加</el-button>
            <el-button type="danger"
                       @click="deleteRow(scope.row.id
)">删除</el-button>
            <el-button type="info">详情

            </el-button>

          </template>
        </el-table-column>
      </el-table>

    </div>

  </div>
</template>

<script lang="ts" setup>
import { reviewerlist ,reviewerdel} from "../../api/reviewer";

import { onMounted, ref, reactive } from "vue";

const input = ref("");

const tableData = reactive({
  list: [],
});






const list = async () => {
  const res = await reviewerlist();
  console.log(res);
  tableData.list=res.data

};

const deleteRow = async (id: any) => {
  console.log(id);
  const res = await reviewerdel({ id });
  console.log(res);
  list();
};

onMounted(() => {
  list();
});
</script>

<style lang="less" scoped>
@import url("../../assets/css/Administrator/adminlist.less");
</style>